﻿@using Eswat.Services.WebDriver
@using OpenQA.Selenium

@{
	// alias test services
	var web = Services.WebDriver;
	var verify = Services.Verify;

	// -------------------------------------------------------------
	// test WebDriver test service
	// -------------------------------------------------------------

	try
	{
		web.Open(WebBrowserType.IE);
		
		var nav = (INavigation)web.Navigate();

		nav.GoToUrl("http://localhost:61614/Auth/SignOut");

		verify.AreEqual("Mileage Stats | Know where your gas takes you", web.Title, "Silk landing page title should match");
	}
	finally { web.Quit(); }

	// -------------------------------------------------------------
	// test NUnit test service
	// -------------------------------------------------------------
	
	verify.True(true);
	verify.True(true, "True(true) should succeed");
	verify.True(true, "True({0}) should succeed", "true");
	verify.True(false, "True(false) should fail");

	verify.IsTrue(true);
	verify.IsTrue(true, "IsTrue(true) should succeed");
	verify.IsTrue(true, "IsTrue({0}) should succeed", "true");
	verify.IsTrue(false, "IsTrue(false) should fail");

	verify.False(false);
	verify.False(false, "False(false) should succeed");
	verify.False(false, "False({0}) should succeed", "false");
	verify.False(true, "False(true) should fail");

	verify.IsFalse(false);
	verify.IsFalse(false, "IsFalse(false) should succeed");
	verify.IsFalse(false, "IsFalse({0}) should succeed", "false");
	verify.IsFalse(true, "IsFalse(true) should fail");

	// bool
	verify.AreEqual(true, true);
	verify.AreEqual(true, true, "AreEqual(true, true) should succeed");
	verify.AreEqual(true, true, "AreEqual({0}) should succeed", "true, true");
	verify.AreEqual(true, false, "AreEqual(true, false) should fail");

	// float
	verify.AreEqual(0f, 0f);
	verify.AreEqual(0f, 0f, "AreEqual(0f, 0f) should succeed");
	verify.AreEqual(0f, 0f, "AreEqual({0}) should succeed", "0f, 0f");
	verify.AreEqual(0f, 1f, "AreEqual(0f, 1f) should fail");

	// double
	verify.AreEqual(0d, 0d);
	verify.AreEqual(0d, 0d, "AreEqual(0d, 0d) should succeed");
	verify.AreEqual(0d, 0d, "AreEqual({0}) should succeed", "0d, 0d");
	verify.AreEqual(0d, 1d, "AreEqual(0d, 1d) should fail");

	// decimal
	verify.AreEqual(0m, 0m);
	verify.AreEqual(0m, 0m, "AreEqual(0m, 0m) should succeed");
	verify.AreEqual(0m, 0m, "AreEqual({0}) should succeed", "0m, 0m");
	verify.AreEqual(0m, 1m, "AreEqual(0m, 1m) should fail");
}